<template>
  <div class="home" :style="{'height':bodyHeight}">
    <div class="head">
      <div>
        <span>
          大学
          <span>OA</span>管理系统
        </span>
        <div>UNIVERSITY OA MS</div>
      </div>

      <div class="div">
        <img :src="img" alt />
        <span>
          <span>{{name}}</span>欢迎你
        </span>
        <button>退出</button>
      </div>
    </div>
    <div class="body">
      <div class="a">
        <img :src="img" alt />
        <div class="wi">{{name}}</div>
      </div>
      <div class="b">
        <div class="b1 c">
          <i class="el-icon-user i1"></i>
          <div>智能内外勤</div>
        </div>
        <div class="b2 c">
          <i class="el-icon-s-order i2"></i>
          <div>工作汇报</div>
        </div>
        <div class="b3 c">
          <i class="el-icon-s-claim i3"></i>
          <div>学校管理</div>
        </div>
        <div class="b4 c">
          <i class="el-icon-s-custom i4"></i>
          <div>高效办公</div>
        </div>
        <div class="b5 c">
          <i class="el-icon-s-promotion i5"></i>
          <div>学籍成绩</div>
        </div>
        <div class="b6 c">
          <i class="el-icon-setting i6"></i>
          <div>系统设置</div>
        </div>
      </div>
    </div>
    <div class="content">
      <div>
        <div class="left">
          <div class="div1">
            <div>
              <i class="el-icon-info icon1"></i>
              <div class="text">待处理</div>
              <div>{{deal}}</div>
            </div>
            <div>
              <i class="el-icon-first-aid-kit icon2"></i>
              <div class="text">请假人数</div>
              <div>{{off}}</div>
            </div>
            <div>
              <i class="el-icon-collection-tag icon3"></i>
              <div class="text">相关事宜</div>
              <div>{{real}}</div>
            </div>
          </div>
          <div class="info">
            <div class="div2">最新通知</div>
            <div class="information" v-for="(item,index) in info" :key="index">
              <div class="d">
                <img :src="item.img" alt />
                <div>{{name}}</div>
              </div>
              <div class="d1">
                <div class="title">{{item.title}}</div>
                <div class="cover">{{item.content}}</div>
                <div class="date">{{item.time}}</div>
              </div>
            </div>
          </div>
        </div>
        <div class="right">
          <el-calendar v-model="value" class="rili"></el-calendar>
          <div class="div3">
            <div>
              <i class="el-icon-location" :style="{'color':'green'}"></i>
              当前城市：{{city}}
            </div>
            <div>
              <i class="el-icon-sunrise-1" :style="{'color':'aqua'}"></i>
              温度：{{wendu}}℃
            </div>
            <div>
              <i class="el-icon-warning-outline" :style="{'color':'red'}"></i>
              小提示：{{ganmao}}
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      name: "xxx",
      bodyHeight: window.innerHeight - 16 + "px",
      bodywidth: "2",
      value: new Date(),
      city: "",
      wendu: "",
      ganmao: "",
      img: require("./assets/logo.png"),
      info: [
        {
          img: require("./assets/logo.png"),
          title: "北京北京",
          content: "2008年奥运会成功在北京召开，鸟巢因其巧夺天工得到举世瞩目",
          time: "2020-5-25",
        },
        {
          img: require("./assets/logo.png"),
          title: "上海上海",
          content: "2008年奥运会成功在北京召开，鸟巢因其巧夺天工得到举世瞩目",
          time: "2020-5-25",
        },
        {
          img: require("./assets/logo.png"),
          title: "成都成都",
          content: "2008年奥运会成功在北京召开，鸟巢因其巧夺天工得到举世瞩目",
          time: "2020-5-25",
        },
        {
          img: require("./assets/logo.png"),
          title: "天津天津",
          content: "2008年奥运会成功在北京召开，鸟巢因其巧夺天工得到举世瞩目",
          time: "2020-5-25",
        },
      ],
      deal: 0,
      off: 1,
      real: 2,
    };
  },
  mounted() {
    window.onresize = () => {
      this.bodyHeight = window.innerHeight - 16 + "px";
    };
  },
  created() {
    let that = this;
    this.$axios
      .get("http://wthrcdn.etouch.cn/weather_mini?city=成都")
      .then(function (response) {
        that.city = response.data.data.city;
        that.wendu = response.data.data.wendu;
        that.ganmao = response.data.data.ganmao;
        console.log(that.city);
        console.log(that.wendu);
        console.log(that.ganmao);
      })
      .catch(function (error) {
        // console.log(error);
      });
  },
};
</script>

<style scoped lang="less">
.rili:hover{
  transform: scale(1.5);
  position: relative;
  z-index: 200;
}
.wi {
  width: 82px;
}
.div3 {
  position: absolute;
  width: 100%;
  background-color: #fff;
  height: 30%;
  top: -33%;
  border-radius: 5px;
  font-size: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  & div {
    margin-left: 20px;
    width: 100%;
  }
}
.right {
  float: right;
  // height: 100px !important;
  width: 40%;
  position: absolute;
  top: 3%;
  right: 0px;
  transform: scale(0.6);
  border: 1px solid red;
  // margin-top: 0px;
}
.information {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 90%;
  margin: 0px auto;
  // border:1px solid red;
  border: 1px solid;
  border-color: transparent silver silver silver;
  // margin-top: 1px;
  & > .d {
    text-align: center;
    margin-left: 3%;
  }
  & .d1 {
    width: 90%;
    & > .title {
      font-weight: 600;
      font-size: 16px;
      // border-bottom: 1px solid silver;
    }
    & .date {
      font-size: 12px;
    }
  }
  & img {
    width: 40px;
    border-radius: 50%;
    border: 1px solid silver;
    height: 40px;
  }
}
.info {
  // border: 1px solid red;
  box-shadow: 0 0 1px 1px silver;
  margin-top: 20px;
  background-color: #fff;
  width: 91.7%;
  margin: 0px auto;
  padding-bottom: 30px;
  overflow: hidden;
  border-radius: 5px;
  & > .div2 {
    margin: 0px auto;
    text-align: center;
    width: 95%;
    margin: 0px auto;
    margin-top: 5px;
    border-bottom: 1px solid silver;
    padding-bottom: 5px;
    // border: 1px solid red;
  }
  // border: 1px solid red;
}
.text {
  margin-top: 15px;
}
.left {
  margin-bottom: 10px;
  float: left;
  // background-color: #fff;
  width: 60%;
  // height: 30%;
  & > .div1 {
    // border: 1px solid red;
    border-radius: 5px;
    margin-bottom: 10px;
    & > div {
      box-shadow: 0 0 1px 1px rgb(167, 166, 166);
      background-color: #fff;
      width: 25%;
      border-radius: 5px;
      height: 80px;
      position: relative;
      margin-top: 40px;
      text-align: right;
      & > div {
        font-weight: 300;
        margin-right: 20px;
      }
      & > div:nth-of-type(2) {
        font-weight: 600;
      }
    }
    display: flex;
    justify-content: space-around;
    & .icon1 {
      border-radius: 10px;
      top: -40%;
      z-index: 3;
      left: 15%;
      background-color: yellowgreen;
      color: white;
      position: absolute;
      font-size: 70px;
    }
    & .icon2 {
      border-radius: 10px;
      top: -40%;
      z-index: 3;
      left: 15%;
      background-color: tomato;
      color: white;
      position: absolute;
      font-size: 70px;
    }
    & .icon3 {
      border-radius: 10px;
      top: -40%;
      z-index: 3;
      left: 15%;
      background-color: aquamarine;
      color: white;
      position: absolute;
      font-size: 70px;
    }
  }
}
.content {
  position: relative;
  background: url("./assets/780.jpg") no-repeat;
  background-size: cover;
  width: 100%;
  height: 58%;
  overflow: hidden;
  & > div {
    width: 90%;
    margin: 0px auto;
    height: 95%;
    // background-color: rgb(236, 236, 236);
    // margin-top: 30px;
  }
}
.b2 {
  margin-top: 60px;
}
.b3 {
  margin-top: 80px;
}
.b4 {
  margin-top: 80px;
}
.b5 {
  margin-top: 60px;
}
.b {
  display: flex;
  justify-content: space-around;
  width: 80%;
  height: 60%;
  margin: 0px auto;
  // border: 1px solid red;

  & > div {
    // border: 1px solid white;
    width: 7%;
    height: 50%;
    text-align: center;
    & > i:hover {
      box-shadow: 0 0 5px 3px white;
      transform: scale(1.1);
      transition: all 0.3s;
    }
    & > .i1 {
      color: green;
      border-radius: 50%;
      border: 1px solid green;
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > .i2 {
      color: blue;
      border-radius: 50%;
      border: 1px solid blue;
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > .i3 {
      color: rgb(14, 117, 185);
      border-radius: 50%;
      border: 1px solid rgb(14, 117, 185);
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > .i4 {
      color: rgb(190, 206, 43);
      border-radius: 50%;
      border: 1px solid rgb(190, 206, 43);
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > .i5 {
      color: rgb(180, 72, 212);
      border-radius: 50%;
      border: 1px solid rgb(180, 72, 212);
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > .i6 {
      color: rgb(240, 20, 20);
      border-radius: 50%;
      border: 1px solid rgb(240, 20, 20);
      box-shadow: 0 0 1px 1px white;
      background-color: #fff;
      font-size: 40px;
    }
    & > div {
      font-size: 12px;
      color: white;
      font-family: "楷体";
      margin-top: 5px;
      font-size: 14px;
      text-align: center;
    }
    // border-radius: 50%;
  }
}
.a {
  width: 4%;
  // border: 1px solid red;
  margin: 0px auto;
  padding-top: 20px;
  height: 35%;
  & > img {
    width: 80px;
    height: 80px;
    border: 1px solid black;
    border-radius: 50%;
  }
  & > div {
    text-align: center;
    color: white;
    font-weight: 600;
  }
}
.body {
  width: 100%;
  height: 33%;
  margin-top: 1px;
  box-shadow: 0 0 3px 1px rgb(223, 222, 222);
  background: url(./assets/781.jpg) no-repeat;
  background-size: 100% 100%;
  // background-position: 0px -550px;
}
.head {
  height: 80px;
  box-shadow: 0 0 3px 1px silver;
  background-color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  // border: 1px solid black;
  & > div:nth-of-type(1) {
    margin-left: 2%;
    & > span {
      font-weight: 600;
      font-size: 26px;
      font-family: "华文行楷";
      & > span {
        font-family: "Times New Roman";
      }
    }
    & div {
      font-size: 12px;
      text-align: center;
      font-weight: 600;
      font-family: "Times New Roman";
    }
  }
}
.div {
  display: flex;
  width: 200px;
  justify-content: space-between;
  align-items: center;
  margin-right: 3%;
  & img {
    border: 1px solid silver;
    border-radius: 50%;
    width: 50px;
    height: 50px;
  }
  & > span {
    margin-left: -10%;
    font-family: "楷体";
    font-weight: 600;
    font-size: 17px;
  }
  & button {
    // border-radius: 5px;
    // height: 40px;
  }
}
</style>
